﻿using SqlSugar;

namespace Luka;

/// <summary>
/// 是否删除
/// </summary>
public interface IDeleted
{
    public bool IsDeleted { get; set; }
}

/// <summary>
/// 主键
/// </summary>
public class PrimaryKey
{
    /// <summary>
    /// 主键id
    /// </summary>
    [SugarColumn(IsPrimaryKey = true, ColumnName = "Id")]
    public long Id { get; set; }
}

/// <summary>
/// 基础类型
/// </summary>
public class BaseEntity : PrimaryKey, IDeleted
{
    /// <summary>
    /// 创建时间
    /// </summary>
    [SugarColumn(ColumnName = "CreatedTime", IsNullable = true)]
    public DateTime? CreatedTime { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    [SugarColumn(ColumnName = "CreatedTime", IsNullable = true)]
    public long? CreatedUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    [SugarColumn(ColumnName = "UpdatedTime", IsNullable = true)]
    public DateTime? UpdatedTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    [SugarColumn(ColumnName = "UpdatedTime", IsNullable = true)]
    public long? UpdatedUser { get; set; }

    /// <summary>
    /// 是否删除
    /// </summary>
    [SugarColumn(ColumnName = "IsDeleted", DefaultValue = "0")]
    public bool IsDeleted { get; set; }
}